package com.ef.service.impl;

import com.ef.constant.StatusType;
import com.ef.dao.ComplainDao;
import com.ef.domain.Complain;
import com.ef.service.ComplainService;
import com.ef.util.CustomExample;
import com.ef.util.PaginationSupport;

public class ComplainServiceImpl extends BaseServiceImpl implements
		ComplainService {

	private ComplainDao complainDao;

	public void delete(Complain entity) {
		entity.setStatus(StatusType.INVALID);
		complainDao.update(entity);
	}

	public PaginationSupport<Complain> findByExample(
			CustomExample<Complain> example, int startIndex, int pageSize) {

		return complainDao.findPageByExample(example, startIndex, pageSize);
	}

	public Complain findById(Long id) {

		return complainDao.findById(id);
	}

	public void saveOrUpdate(Complain entity) {
		complainDao.saveOrUpdate(entity);
	}

	public ComplainDao getComplainDao() {
		return complainDao;
	}

	public void setComplainDao(ComplainDao complainDao) {
		this.complainDao = complainDao;
	}

}
